import { axios } from '@/utils/request'

export function createServer(createform,userId) {
    return axios({
      url: '/server/add',
      method: 'post',
      data:{"server":createform,"userId":userId}
    })
}

export function getServer(serverform,currentpage,pageSize) {
    return axios({
      url: '/server/getServer',
      method: 'post',
      data:{"server":serverform,"current":currentpage,"pageSize":pageSize}
    })
}

export function getIpList() {
    return axios({
      url: '/server/getIps',
      method: 'get',
    })
}

export function getEnvList() {
    return axios({
      url: '/server/getEnvs',
      method: 'get',
    })
}

export function delServer(serverId) {
    return axios({
      url: '/server/delServer',
      method: 'post',
      data:serverId
    })
}

export function getServerDetail(serverId) {
    return axios({
      url: '/server/getServerDetail',
      method: 'post',
      data:serverId
    })
}

export function editServer(server,userId) {
    return axios({
      url: '/server/editServer',
      method: 'post',
      data:{'server':server,'userId':userId}
    })
}